Skip to content

Conversation

hugoaguirre
Copy link
Contributor

@hugoaguirre hugoaguirre commented Sep 6, 2025

Checklist (if applicable):

@github-actions github-actions bot added the docs Improvements or additions to documentation label Sep 10, 2025
@hugoaguirre hugoaguirre marked this pull request as ready for review September 15, 2025 21:14
@@ -613,6 +613,11 @@ func translateCandidate(cand *genai.Candidate) *ai.ModelResponse {
m.FinishReason = ai.FinishReasonUnknown
}
msg := &ai.Message{}
if cand.Content == nil {
m.Message = msg
Copy link
Contributor Author

@hugoaguirre hugoaguirre Sep 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@apascal07 when testing MCP, there were some spurious responses that returned no errors but no candidates on them. When falling in this corner case, should we panic or silently return an empty response message?

Copy link
Collaborator

@apascal07 apascal07 Sep 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which responses are you referring to? It's intermittent or it fails for certain requests consistently?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah the responses from the plugin sometimes come with no candidates when running the mcp-client sample using the client example. I'd say 2 out of 5 times the issue is reproducible.

Copy link
Collaborator

@apascal07 apascal07 Sep 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then create an error and return it saying no valid candidates were produced. That's pretty weird though that there is neither a response nor an error. Please sort this out with @huangjeff5.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the cause of the intermittent issue was this: 8094cbd

Can you give it another try?

Copy link
Contributor Author

@hugoaguirre hugoaguirre Sep 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @huangjeff5. I encountered an issue at main in the mcp-client sample where the model ref was not getting resolved when calling generate().

The tools are always being listed now, but every time I try to run the generate call using the WithModelName() helper function, the model resolution does not happen successfully.

I'll continue the investigation later today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation go
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants